home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW noweb 2.7 / src / xdoc / notangle.txt < prev    next >
Encoding:
Text File  |  1995-05-30  |  20.2 KB  |  463 lines  |  [????/????]

  1.  
  2.  
  3.  
  4. NOWEB(1)                                                 NOWEB(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        notangle,   noweave,   nountangle  -  noweb,  a  literate-
  9.        programming tool
  10.  
  11. SSYYNNOOPPSSIISS
  12.        nnoottaannggllee  [--RRrootname]  [--ffiilltteerr   command]   [--LL[format]]
  13.        [file] ...
  14.        nnoouunnttaannggllee  [--mmll|--mm33|--cc|--cc++++|--aawwkk|--tteexx|--ff7777|--ff9900] [--RRroot-
  15.        name] [--ffiilltteerr command] [--wwwidth] [file] ...
  16.        nnoowweeaavvee [options] [file] ...
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.        _N_o_w_e_b is a literate-programming  tool  like  Knuth's  _W_E_B_,
  20.        only  simpler.   A _n_o_w_e_b file contains program source code
  21.        interleaved with documentation.  When _n_o_t_a_n_g_l_e is given  a
  22.        _n_o_w_e_b  file,  it  writes  the  program on standard output.
  23.        When _n_o_w_e_a_v_e is given a _n_o_w_e_b file,  it  reads  the  _n_o_w_e_b
  24.        source  and  produces,  on standard output, _L_a_T_e_X, _T_e_X, or
  25.        _H_T_M_L source for typeset  documentation.   _n_o_u_n_t_a_n_g_l_e  con-
  26.        verts a literate program into an ordinary program by turn-
  27.        ing interleaved documentation  into  comments.   The  file
  28.        name `-' refers to standard input.
  29.  
  30. FFOORRMMAATT OOFF NNOOWWEEBB FFIILLEESS
  31.        A  _n_o_w_e_b file is a sequence of _c_h_u_n_k_s_, which may appear in
  32.        any order.  A chunk may  contain  code  or  documentation.
  33.        Documentation chunks begin with a line that starts with an
  34.        at sign (@) followed by a space or newline.  They have  no
  35.        names.  Code chunks begin with
  36.        <<_c_h_u_n_k _n_a_m_e>>=
  37.        on  a  line by itself.  The double left angle bracket (<<)
  38.        must be in the first column.  Chunks are terminated by the
  39.        beginning  of  another  chunk,  or by end of file.  If the
  40.        first line in the file does not mark the  beginning  of  a
  41.        chunk,  it is assumed to be the first line of a documenta-
  42.        tion chunk.
  43.  
  44.        Documentation chunks  contain  text  that  is  ignored  by
  45.        _n_o_t_a_n_g_l_e and copied verbatim to standard output by _n_o_w_e_a_v_e
  46.        (except for quoted code).  _n_o_w_e_a_v_e can  work  with  _L_a_T_e_X,
  47.        plain  _T_e_X,  or _H_T_M_L.  With plain _T_e_X, it inserts a refer-
  48.        ence to a _T_e_X macro package, _n_w_m_a_c, which defines commands
  49.        like \\cchhaapptteerr and \\sseeccttiioonn..
  50.  
  51.        Code  chunks contain program source code and references to
  52.        other code chunks.  Several code chunks may have the  same
  53.        name; _n_o_t_a_n_g_l_e concatenates their definitions to produce a
  54.        single chunk, just as does _t_a_n_g_l_e_(_1_)_.  Code chunk  defini-
  55.        tions are like macro definitions; _n_o_t_a_n_g_l_e extracts a pro-
  56.        gram by expanding one chunk (by default, the  chunk  named
  57.        <<<<*>>>>).   The definition of that chunk contains references
  58.        to other chunks, which are themselves expanded, and so on.
  59.        _n_o_t_a_n_g_l_e's  output  is readable; it preserves the indenta-
  60.        tion of expanded chunks with  respect  to  the  chunks  in
  61.  
  62.  
  63.  
  64.                           local 4/19/93                         1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. NOWEB(1)                                                 NOWEB(1)
  71.  
  72.  
  73.        which they appear.
  74.  
  75.        Code  may be quoted within documentation chunks by placing
  76.        double square brackets ([[[[_._._.]]]]) around it.  These  double
  77.        square  brackets  are ignored by _n_o_t_a_n_g_l_e_, but they may be
  78.        used by _n_o_w_e_a_v_e  to  give  the  code  special  typographic
  79.        treatment,  e.g.,  hypertext  links.   If quoted code ends
  80.        with three or more square  brackets,  _n_o_w_e_a_v_e  choose  the
  81.        rightmost  pair,  so that, for example, [[[[aa[[ii]]]]]] is parsed
  82.        correctly.
  83.  
  84.        If double left and right angle brackets  are  not  paired,
  85.        they  are  treated  as literal <<<< and >>>>.  Users can force
  86.        any such brackets, even paired brackets, to be treated  as
  87.        literal by using a preceding at sign (e.g. @@<<<<).
  88.  
  89.        Any  line beginning with `@@ ' terminates a code chunk, but
  90.        if the line has the form
  91.        @@ %%ddeeff _i_d_e_n_t_i_f_i_e_r_s
  92.        it is taken to mean that the preceding chunk  defines  the
  93.        identifiers  listed  in  _i_d_e_n_t_i_f_i_e_r_s_.   This list contains
  94.        identifiers separated by whitespace; any sequence of  non-
  95.        white  characters may be an identifier.  _n_o_w_e_b uses a sim-
  96.        ple heuristic to avoid recognizing  identifiers  that  are
  97.        substrings of other identifiers.
  98.  
  99. TTAANNGGLLIINNGG
  100.        _n_o_t_a_n_g_l_e  and  _n_o_u_n_t_a_n_g_l_e  accept the same set of options,
  101.        although some options have effects  only  on  one  or  the
  102.        other.  The options are:
  103.  
  104.        --RR_n_a_m_e Expand the <<<<_n_a_m_e>>>> code chunk instead of <<<<*>>>>.
  105.  
  106.        --LL_f_o_r_m_a_t
  107.               Emit  line  number indications at chunk boundaries.
  108.               A line number indication identifies the  source  of
  109.               the  line that follows it.  In _f_o_r_m_a_t_, %%FF indicates
  110.               the name of the source file, %%LL indicates the  line
  111.               number  of the source file, %%NN indicates a newline,
  112.               and %%%% indicates a percent sign.  A sign and  digit
  113.               may  be  inserted  between the percent sign and the
  114.               `LL', in which case the line number will be adjusted
  115.               by  that amount.  If _f_o_r_m_a_t is omitted, the default
  116.               format is that  accepted  by  the  C  preprocessor:
  117.               `##lliinnee %%LL ""%%FF""%%NN'.  When using the --LL_f_o_r_m_a_t option,
  118.               _n_o_t_a_n_g_l_e ensures that all text appears in the  same
  119.               column  in  input  and  output.  _n_o_u_n_t_a_n_g_l_e ignores
  120.               this option.
  121.  
  122.        --tt_k    Copy tabs untouched from input to output,  and  use
  123.               tabs   for  indentation,  assuming  stops  every  _k
  124.               columns.  By default, tabs are expanded  to  spaces
  125.               with stops every 8 columns.
  126.  
  127.  
  128.  
  129.  
  130.                           local 4/19/93                         2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. NOWEB(1)                                                 NOWEB(1)
  137.  
  138.  
  139.        --ffiilltteerr _c_m_d
  140.               Filter  the _n_o_w_e_b source through _c_m_d after convert-
  141.               ing it to tool form and before tangling.   _n_o_t_a_n_g_l_e
  142.               looks  for  _c_m_d  first  on the user's PPAATTHH,, then in
  143.               ||LLIIBBDDIIRR||..  Such filters can be used to add features
  144.               to _n_o_t_a_n_g_l_e_; for an example see ||LLIIBBDDIIRR||//eemmppttyyddeeffnn..
  145.               For experts only.
  146.  
  147.        --mmaarrkkuupp _p_a_r_s_e_r
  148.               Use _p_a_r_s_e_r to parse the input file.  Enables use of
  149.               noweb tools on files in other formats; for example,
  150.               the nnuummaarrkkuupp parser  understands  _n_u_w_e_b_(_1_)  format.
  151.               See  _n_o_w_e_b_f_i_l_t_e_r_s_(_1_)  for  more  information.   For
  152.               experts only.
  153.  
  154.        --aawwkk || --cc || --iiccnn || --iiccoonn || --mmll || --mm33 || --ppaassccaall || --ff7777  ||
  155.               --ff9900  || --tteexx
  156.               When  _n_o_u_n_t_a_n_g_l_e  transforms  documentation  chunks
  157.               into  comments,  use the comment format of the lan-
  158.               guage named.  --cc is the default.  _n_o_t_a_n_g_l_e  ignores
  159.               these options.
  160.  
  161.        --ww_n    When  _n_o_u_n_t_a_n_g_l_e  transforms  documentation  chunks
  162.               into comments, create comments on lines of width _n.
  163.               _n_o_t_a_n_g_l_e ignores this option.
  164.  
  165. WWEEAAVVIINNGG
  166.        Output  from  _n_o_w_e_a_v_e  can  be  used in _T_e_X documents that
  167.        \\iinnppuutt nnwwmmaacc,, in _L_a_T_e_X documents that  use the nnoowweebb docu-
  168.        ment-style  option  (see _n_o_w_e_b_s_t_y_l_e_(_1_)), and in _H_T_M_L docu-
  169.        ments to be browsed with _M_o_s_a_i_c_(_1_)_.  _N_o_w_e_a_v_e  treats  code
  170.        chunks  somewhat like _L_a_T_e_X _l_i_s_t _e_n_v_i_r_o_n_m_e_n_t_s_.  If the ``@@
  171.        '' that terminates a code chunk is followed immediately by
  172.        text, that text follows the code chunk without a paragraph
  173.        break.  If the rest of the line is blank, _n_o_w_e_a_v_e puts _T_e_X
  174.        into  ``vertical  mode,''  and  later text starts a fresh,
  175.        indented paragraph.
  176.  
  177.        No page breaks occur in the middle of code  chunks  unless
  178.        necessary  to  avoid  an overfull vbox.  The documentation
  179.        chunk immediately preceding a code chunk  appears  on  the
  180.        same page as that code chunk unless doing so would violate
  181.        the previous rule.
  182.  
  183.        _N_o_w_e_a_v_e inserts no extra newlines in its  _T_e_X  output,  so
  184.        the  line numbers given in _T_e_X error messages are the same
  185.        as those in the input file.
  186.  
  187.        _n_o_w_e_a_v_e has options that dictate choice of  formatter  and
  188.        that support different formatting idioms and tools.  Basic
  189.        options are described here; options related to  index  and
  190.        cross-reference  information are described in the INDEXING
  191.        AND CROSS-REFERENCE section.
  192.  
  193.  
  194.  
  195.  
  196.                           local 4/19/93                         3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. NOWEB(1)                                                 NOWEB(1)
  203.  
  204.  
  205.        --llaatteexx Use LaTeX wrapper in aarrttiiccllee style with nnoowweebb style
  206.               option and page style. (Default)
  207.  
  208.        --tteexx   Use plain TeX wrapper and the nnwwmmaacc macros.
  209.  
  210.        --hhttmmll  Format  the program for HTML, not TeX or LaTeX.  If
  211.               --nn is not given, use HTML  wrapper  as  well.   The
  212.               output  is uninteresting without --iinnddeexx or --xx.  The
  213.               tags <<nnoowweebbcchhuunnkkss>> and <<nnoowweebbiinnddeexx>>,  on  lines  by
  214.               themselves,  produce  a list of chunks and an index
  215.               of identifiers, respectively.  If  these  tags  are
  216.               not  present,  the list and index are placed at the
  217.               end of the file.
  218.  
  219.        --llaatteexx++hhttmmll
  220.               Assume documentation chunks are LaTeX, but generate
  221.               HTML for code chunks, suitably marked so conversion
  222.               with _l_a_t_e_x_2_h_t_m_l_(_1_)  yields  reasonable  output.   A
  223.               LaTeX  wrapper  is  implied,  but can be turned off
  224.               with --nn.
  225.  
  226.        --nn     Don't use any wrapper (header  or  trailer).   This
  227.               option  is  useful  when _n_o_w_e_a_v_e's output will be a
  228.               part of a larger document.  See also --ddeellaayy..
  229.  
  230.        --ffiilltteerr _c_m_d
  231.               Filters the _n_o_w_e_b source through _c_m_d after convert-
  232.               ing  it  to tool form and before converting to _T_e_X_.
  233.               _n_o_w_e_a_v_e looks for _c_m_d first  on  the  user's  PPAATTHH,,
  234.               then  in ||LLIIBBDDIIRR||..  Such filters can be used to add
  235.               features to _n_o_w_e_a_v_e_;  for  an  example,  see  ||LLIIBB--
  236.               DDIIRR||//nnooxxrreeff..kkrroomm..  _N_o_w_e_a_v_e supports up to four fil-
  237.               ters; one can get more by shell trickery, for exam-
  238.               ple, --ffiilltteerr ""iiccoonn..ffiilltteerr || nnooiiddxx"".  The --aauuttooddeeffss,
  239.               --xx, --iinnddeexx, and --iinnddeexxffrroomm options are  implemented
  240.               as filters.
  241.  
  242.        --mmaarrkkuupp _p_a_r_s_e_r
  243.               Use _p_a_r_s_e_r to parse the input file.  Enables use of
  244.               noweb tools on files in other formats; for example,
  245.               the  nnuummaarrkkuupp  parser  understands _n_u_w_e_b_(_1_) format.
  246.               See  _n_o_w_e_b_f_i_l_t_e_r_s_(_1_)  for  more  information.   For
  247.               experts only.
  248.  
  249.        --ooppttiioonn _o_p_t
  250.               Adds \\nnoowweebbooppttiioonnss{{_o_p_t}} to the _L_a_T_e_X header.  Works
  251.               only with the --llaatteexx option.  See _n_o_w_e_b_s_t_y_l_e_(_1_) for
  252.               values of _o_p_t_.
  253.  
  254.        --ddeellaayy By default, _n_o_w_e_a_v_e puts file-name and other infor-
  255.               mation into the output before the  first  chunk  of
  256.               the  program.  --ddeellaayy delays that information until
  257.               after the first documentation chunk, making  act  a
  258.               little  bit  like the _W_E_B ``limbo.''  The option is
  259.  
  260.  
  261.  
  262.                           local 4/19/93                         4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. NOWEB(1)                                                 NOWEB(1)
  269.  
  270.  
  271.               typically used to enable a user to put  a  special-
  272.               ized  _L_a_T_e_X \\ddooccuummeennttssttyyllee command and other pream-
  273.               ble material  in  the  first  documentation  chunk.
  274.               This  option also forces trailing cross-referencing
  275.               information to be emitted  just  before  the  final
  276.               chunk,  instead  of at the end of the document; the
  277.               final chunk is expected to contain  \\eenndd{{ddooccuummeenntt}}..
  278.               The --ddeellaayy option implies the --nn option.
  279.  
  280.        --tt_k    Expand  tabs  with stops every _k columns.  (Default
  281.               is to expand every 8 columns.)
  282.  
  283.        --tt     Copy tabs to the output.
  284.  
  285.        --vv     Print the pipeline on standard error.
  286.  
  287. IINNDDEEXXIINNGG AANNDD CCRROOSSSS--RREEFFEERREENNCCEE
  288.        When used with _L_a_T_e_X or _H_T_M_L_, _n_o_w_e_a_v_e can provide indexing
  289.        and  cross-reference  information  for chunks and for pro-
  290.        gramming-language identifiers.  Identifier definitions may
  291.        be marked by hand using @@ %%ddeeff, or for some languages they
  292.        may be found automatically  using  the  --aauuttooddeeffss  option.
  293.        This  section  describes  the indexing and cross-reference
  294.        options; it might well be skipped on first reading.
  295.  
  296.        --xx     For _L_a_T_e_X_, add a page number  to  each  chunk  name
  297.               identifying  the  location  of that chunk's defini-
  298.               tion, and emit cross-reference information relating
  299.               definitions  and  uses.  For _H_T_M_L_, create hypertext
  300.               links between uses and definitions of chunks.  When
  301.               nnoowweeaavvee --xx is used with _L_a_T_e_X_, the control sequence
  302.               \\nnoowweebbcchhuunnkkss expands to a sorted list of  all  code
  303.               chunks.
  304.  
  305.        --iinnddeexx Build  cross-reference  information  (or  hypertext
  306.               links) for identifiers defined by
  307.               @@ %%ddeeff _i_d_e_n_t_i_f_i_e_r_s
  308.               Definitions  are  those  found  in   input   files.
  309.               Requires _L_a_T_e_X or _H_T_M_L_.  --iinnddeexx implies --xx;; includ-
  310.               ing  both  will  generate  strange-looking  output.
  311.               _n_o_w_e_a_v_e does not generate cross-references to iden-
  312.               tifiers that appear in quoted code (@@[[[[...@@]]]]), but
  313.               it  does  generate  hypertext  links.  When nnoowweeaavvee
  314.               --iinnddeexx is used with  _L_a_T_e_X_,  the  control  sequence
  315.               \\nnoowweebbiinnddeexx expands to an index of identifiers.
  316.  
  317.        --iinnddeexxffrroomm _i_n_d_e_x
  318.               Like  --iinnddeexx,, but the identifiers to be indexed are
  319.               taken from file _i_n_d_e_x.  See _n_o_i_n_d_e_x_(_1_)_.
  320.  
  321.        --aauuttooddeeffss _l_a_n_g
  322.               Discover  identifier   definitions   automatically.
  323.               Code in chunks must be in language _l_a_n_g.  Permissi-
  324.               ble  _l_a_n_gs  vary  but  may  include  tteexx  or  iiccoonn..
  325.  
  326.  
  327.  
  328.                           local 4/19/93                         5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. NOWEB(1)                                                 NOWEB(1)
  335.  
  336.  
  337.               Useless without --iinnddeexx,, which it must precede.
  338.  
  339.        --sshhoowwaauuttooddeeffss
  340.               Show values of _l_a_n_g usable with --aauuttooddeeffss.
  341.  
  342. EERRRROORR MMEESSSSAAGGEESS
  343.        If _n_o_t_a_n_g_l_e or _n_o_w_e_a_v_e encounters a chunk name within doc-
  344.        umentation, it assumes that this indicates an error,  usu-
  345.        ally  misspelling  ``<<name>>=''.   Other  error  messages
  346.        should be self-explanatory.
  347.  
  348.        It is incorrect to refer to a chunk that is never defined,
  349.        but it is OK for chunks to be defined and not used.
  350.  
  351. FFIILLEESS
  352.        |LIBDIR|/markup            markup preprocessor
  353.        |LIBDIR|/unmarkup          inverts markup
  354.        |LIBDIR|/nt                notangle proper
  355.        |LIBDIR|/finduses          find uses of identifiers for index
  356.        |LIBDIR|/noidx             generate index and cross-reference info
  357.        |LIBDIR|/totex             back end to emit _T_e_X or _L_a_T_e_X
  358.        |LIBDIR|/tohtml            back end to emit HTML
  359.        |TEXINPUTS|/nwmac.tex      formatting _T_e_X macros
  360.        |TEXINPUTS|/noweb.sty      use in _L_a_T_e_X documents; see _n_o_w_e_b_s_t_y_l_e_(_1_)
  361.  
  362. SSEEEE AALLSSOO
  363.        _c_p_i_f_(_1_)_,   _n_o_d_e_f_s_(_1_)_,  _n_o_r_o_o_t_s_(_1_)_,  _n_o_w_e_b_(_1_)_,  _n_o_i_n_d_e_x_(_1_)_,
  364.        _n_o_w_e_b_s_t_y_l_e_(_1_)_, _n_o_w_e_b_f_i_l_t_e_r_s_(_1_)
  365.  
  366. BBUUGGSS
  367.        _n_o_t_a_n_g_l_e and _n_o_u_n_t_a_n_g_l_e fail if names used on the  command
  368.        line contain single quotes.
  369.  
  370.        Ignoring  unused chunks can cause problems; if a chunk has
  371.        multiple definitions and one is misspelled, the misspelled
  372.        definition is silently ignored.  _n_o_r_o_o_t_s_(_1_) can be used to
  373.        catch this mistake.
  374.  
  375.        _n_o_w_e_b requires the new  version  of  _a_w_k_,  assumed  to  be
  376.        called  _n_a_w_k_.   DEC  _n_a_w_k  has  a  bug in that that causes
  377.        nnoowweeaavvee to fail to translate braces correctly.   GNU  _g_a_w_k
  378.        is reported to work.
  379.  
  380.        DEC  _s_h  has  a bug that causes the --ffiilltteerr option to fail
  381.        whenever the filter command contains more than one word.
  382.  
  383.        The default _L_a_T_e_X pagestyles don't set the  width  of  the
  384.        boxes  containing  headers  and footers.  Since _n_o_w_e_b code
  385.        paragraphs  are  extra  wide,  this  _L_a_T_e_X  bug  sometimes
  386.        results  in extra-wide headers and footers.  The remedy is
  387.        to  redefine  the  relevant  ppss@@**  commands;  ppss@@nnoowweebb  in
  388.        nnoowweebb..ssttyy can be used as an example.
  389.  
  390.        _l_a_t_e_x_2_h_t_m_l_(_1_) mangles some source files.
  391.  
  392.  
  393.  
  394.                           local 4/19/93                         6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. NOWEB(1)                                                 NOWEB(1)
  401.  
  402.  
  403.        _n_o_w_e_a_v_e  has  too  many  options, and this man page is too
  404.        long.
  405.  
  406. AAUUTTHHOORR
  407.        Norman   Ramsey,   Bellcore.    Internet   address    nnoorr--
  408.        mmaann@@bbeellllccoorree..ccoomm.
  409.        Noweb               home              page              at
  410.        ffttpp::////bbeellllccoorree..ccoomm//ppuubb//nnoorrmmaann//wwwwww//nnoowweebb//iinnttrroo..hhttmmll.
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                           local 4/19/93                         7
  461.  
  462.  
  463.